package com.yunxi.service.localService.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.dao.order.VehicleReturApplyMapper;
import com.yunxi.model.order.VehicleReturApply;
import com.yunxi.order.pojo.*;
import com.yunxi.service.localService.VehicleReturApplyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 渠道商向厂端申请退车业务
 */
@Service
public class VehicleReturApplyServiceImpl extends ServiceImplPlus<VehicleReturApplyMapper, VehicleReturApply> implements VehicleReturApplyService {

    @Override
    @Transactional
    public PageInfo<VehicleReturApplyQueryRespVO> findListByVO(VehicleReturApplyQueryReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<VehicleReturApplyQueryRespVO> resp = this.baseMapper.findListByVO(vo);
        PageInfo<VehicleReturApplyQueryRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }


    @Override
    @Transactional
    public PageInfo<VehicleReturCheckQueryRespVO> findListByVO2(VehicleReturCheckQueryReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<VehicleReturCheckQueryRespVO> resp = this.baseMapper.findListByVO2(vo);
        PageInfo<VehicleReturCheckQueryRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }

    @Override
    @Transactional
    public PageInfo<VehicleReturOutRespVO> findListByVO3(VehicleReturOutReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<VehicleReturOutRespVO> resp = this.baseMapper.findListByVO3(vo);
        PageInfo<VehicleReturOutRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }

    @Override
    @Transactional
    public PageInfo<VehicleReturStockInRespVO> queryVehicleReturStockIn(VehicleReturStockInReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<VehicleReturStockInRespVO> resp = this.baseMapper.queryVehicleReturStockIn(vo);
        PageInfo<VehicleReturStockInRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }
}
